//
//  CAScrollLayer.swift
//  Documentation
//
//  Created by Toj on 3/8/24.
//
// 滚动图层
// https://www.jianshu.com/p/87d95d25f7a9

public struct CAScrollLayerScrollMode : Hashable, Equatable, RawRepresentable, @unchecked Sendable {

    public init(rawValue: String)
}

@available(iOS 2.0, *)
open class CAScrollLayer : CALayer {

    
    /* Changes the origin of the layer to point 'p'. */
    
    open func scroll(to p: CGPoint)

    
    /* Scroll the contents of the layer to ensure that rect 'r' is visible. */
    
    open func scroll(to r: CGRect)

    
    /* Defines the axes in which the layer may be scrolled. Possible values
     * are `none', `vertically', `horizontally' or `both' (the default). */
    
    open var scrollMode: CAScrollLayerScrollMode
}

extension CALayer {

    
    /* These methods search for the closest ancestor CAScrollLayer of the *
     * receiver, and then call either -scrollToPoint: or -scrollToRect: on
     * that layer with the specified geometry converted from the coordinate
     * space of the receiver to that of the found scroll layer. */
    
    open func scroll(_ p: CGPoint)

    
    open func scrollRectToVisible(_ r: CGRect)

    
    /* Returns the visible region of the receiver, in its own coordinate
     * space. The visible region is the area not clipped by the containing
     * scroll layer. */
    
    open var visibleRect: CGRect { get }
}
extension CAScrollLayerScrollMode {

    
    @available(iOS 2.0, *)
    public static let none: CAScrollLayerScrollMode

    
    @available(iOS 2.0, *)
    public static let vertically: CAScrollLayerScrollMode

    
    @available(iOS 2.0, *)
    public static let horizontally: CAScrollLayerScrollMode

    
    @available(iOS 2.0, *)
    public static let both: CAScrollLayerScrollMode
}
